package test;

import java.util.*;

/**
 * @author oldliu
 * @since 1.0
 */
public class GetPass {
    public static void main(String[] args) {
       int len=11;
        String mami1="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        String mami2="abcdefghijklmnopqrstuvwxyz";
        String mami3="0123456789";
        String mami4="~!@#$%^&*()_+`-=[]{}|<>?";
        String []ar={mami1,mami2,mami3,mami4};
        StringBuilder sb=new StringBuilder();
        Random r=new Random();
        for (int i = 0; i < ar.length; i++) {
            sb.append(ar[i].charAt(r.nextInt(ar[i].length())));
        }
        for (int i = 4; i <len ; i++) {
            int k=r.nextInt(4);
            sb.append(ar[k].charAt(r.nextInt(ar[k].length())));
        }
        char[] cr = sb.toString().toCharArray();
        List list=new ArrayList();
        for(char c:cr)
            list.add(c);

        Collections.shuffle(list);
        String str="";
        for(Object c:list)
            str+=c;
        System.out.println(str);
    }
}
